package wps

import (
	"github.com/zzl/go-com/com"
	"github.com/zzl/go-com/ole"
	"github.com/zzl/go-win32api/v2/win32"
	"syscall"
)

// 45541F00-5750-5300-4B49-4E47534F4655
var IID_DebugTools_ = syscall.GUID{0x45541F00, 0x5750, 0x5300,
	[8]byte{0x4B, 0x49, 0x4E, 0x47, 0x53, 0x4F, 0x46, 0x55}}

type DebugTools_ struct {
	ole.OleClient
}

func NewDebugTools_(pDisp *win32.IDispatch, addRef bool, scoped bool) *DebugTools_ {
	if pDisp == nil {
		return nil
	}
	p := &DebugTools_{ole.OleClient{pDisp}}
	if addRef {
		pDisp.AddRef()
	}
	if scoped {
		com.AddToScope(p)
	}
	return p
}

func DebugTools_FromVar(v ole.Variant) *DebugTools_ {
	return NewDebugTools_(v.IDispatch(), false, false)
}

func (this *DebugTools_) IID() *syscall.GUID {
	return &IID_DebugTools_
}

func (this *DebugTools_) GetIDispatch(addRef bool) *win32.IDispatch {
	if addRef {
		this.AddRef()
	}
	return this.IDispatch
}

func (this *DebugTools_) Dump(path string) {
	retVal, _ := this.Call(0x0fff0001, []interface{}{path})
	_ = retVal
}

func (this *DebugTools_) Do() {
	retVal, _ := this.Call(0x0fff0002, nil)
	_ = retVal
}

func (this *DebugTools_) Diagnose() {
	retVal, _ := this.Call(0x0fff0003, nil)
	_ = retVal
}

func (this *DebugTools_) Report() {
	retVal, _ := this.Call(0x0fff0004, nil)
	_ = retVal
}

func (this *DebugTools_) Profile() {
	retVal, _ := this.Call(0x0fff0005, nil)
	_ = retVal
}

var DebugTools__RunCommand_OptArgs = []string{
	"param1", "param2", "param3",
}

func (this *DebugTools_) RunCommand(cmdid int32, optArgs ...interface{}) {
	optArgs = ole.ProcessOptArgs(DebugTools__RunCommand_OptArgs, optArgs)
	retVal, _ := this.Call(0x0fff0006, []interface{}{cmdid}, optArgs...)
	_ = retVal
}

func (this *DebugTools_) GetResult(cmdid int32, param interface{}) ole.Variant {
	retVal, _ := this.Call(0x0fff0007, []interface{}{cmdid, param})
	com.AddToScope(retVal)
	return *retVal
}

func (this *DebugTools_) Solver() *Solver {
	retVal, _ := this.PropGet(0x0fff0008, nil)
	return NewSolver(retVal.IDispatch(), false, true)
}

func (this *DebugTools_) SetDisableMsgBox(rhs bool) {
	_ = this.PropPut(0x0fff0009, []interface{}{rhs})
}

func (this *DebugTools_) UndoTransBegin(book *Workbook) {
	retVal, _ := this.Call(0x0fff000a, []interface{}{book})
	_ = retVal
}

func (this *DebugTools_) UndoTransEnd(book *Workbook, cancelTrans bool, desc string) {
	retVal, _ := this.Call(0x0fff000b, []interface{}{book, cancelTrans, desc})
	_ = retVal
}
